

<%@ page import="br.academia.Professor" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'professor.label', default: 'Professor')}" />
        <title><g:message code="default.edit.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
           <h1 id="pageName">Altera Professor</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${professorInstance}">
            <div class="errors">
                <g:renderErrors bean="${professorInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${professorInstance?.id}" />
                <g:hiddenField name="version" value="${professorInstance?.version}" />
                    <table class="IadTableForm">
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="username"><g:message code="professor.username.label" default="Username" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'username', 'errors')}">
                                    <g:textField name="username" value="${professorInstance?.username}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="nome"><g:message code="professor.nome.label" default="Nome" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'nome', 'errors')}">
                                    <g:textField name="nome" value="${professorInstance?.nome}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="telefone"><g:message code="professor.telefone.label" default="Telefone" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'telefone', 'errors')}">
                                    <g:textField name="telefone" value="${professorInstance?.telefone}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="matricula"><g:message code="professor.matricula.label" default="Matricula" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'matricula', 'errors')}">
                                    <g:textField name="matricula" maxlength="6" value="${professorInstance?.matricula}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="dataDeIngresso"><g:message code="professor.dataDeIngresso.label" default="Data De Ingresso" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'dataDeIngresso', 'errors')}">
                                    <g:datePicker name="dataDeIngresso" precision="day" value="${professorInstance?.dataDeIngresso}"  />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="totalDePontos"><g:message code="professor.totalDePontos.label" default="Total De Pontos" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'totalDePontos', 'errors')}">
                                    <g:textField name="totalDePontos" value="${fieldValue(bean: professorInstance, field: 'totalDePontos')}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="departamento"><g:message code="professor.departamento.label" default="Departamento" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'departamento', 'errors')}">
                                    <g:select name="departamento.id" from="${br.academia.Departamento.list()}" optionKey="id" value="${professorInstance?.departamento?.id}" noSelection="['null': '']" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="classe"><g:message code="professor.classe.label" default="Classe" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'classe', 'errors')}">
                                    <g:select name="classe.id" from="${br.atribicoes.professor.ClasseDoProfessor.list()}" optionKey="id" value="${professorInstance?.classe?.id}" noSelection="['null': '']" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="nivel"><g:message code="professor.nivel.label" default="Nivel" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'nivel', 'errors')}">
                                    <g:select name="nivel.id" from="${br.atribicoes.professor.NivelDoProfessor.list()}" optionKey="id" value="${professorInstance?.nivel?.id}" noSelection="['null': '']" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="CPF"><g:message code="professor.CPF.label" default="CPF" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'CPF', 'errors')}">
                                    <g:textField name="CPF" value="${professorInstance?.CPF}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="atividadesAdministrativas"><g:message code="professor.atividadesAdministrativas.label" default="Atividades Administrativas" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'atividadesAdministrativas', 'errors')}">
                                    <g:select name="atividadesAdministrativas" from="${br.atribicoes.professor.AtividadeAdministrativa.list()}" multiple="yes" optionKey="id" size="5" value="${professorInstance?.atividadesAdministrativas*.id}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="atividadesEnsino"><g:message code="professor.atividadesEnsino.label" default="Atividades Ensino" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'atividadesEnsino', 'errors')}">
                                    <g:select name="atividadesEnsino" from="${br.atribicoes.professor.AtividadeEnsino.list()}" multiple="yes" optionKey="id" size="5" value="${professorInstance?.atividadesEnsino*.id}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="email"><g:message code="professor.email.label" default="Email" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'email', 'errors')}">
                                    <g:textField name="email" value="${professorInstance?.email}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="memorial"><g:message code="professor.memorial.label" default="Memorial" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'memorial', 'errors')}">
                                    
<ul>
<g:each in="${professorInstance?.memorial?}" var="m">
    <li><g:link controller="memorial" action="show" id="${m.id}">${m?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="memorial" action="create" params="['professor.id': professorInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'memorial.label', default: 'Memorial')])}</g:link>

                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="orientacoes"><g:message code="professor.orientacoes.label" default="Orientacoes" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'orientacoes', 'errors')}">
                                    <g:select name="orientacoes" from="${br.atribicoes.professor.Orientacao.list()}" multiple="yes" optionKey="id" size="5" value="${professorInstance?.orientacoes*.id}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="passwordHash"><g:message code="professor.passwordHash.label" default="Password Hash" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'passwordHash', 'errors')}">
                                    <g:textField name="passwordHash" value="${professorInstance?.passwordHash}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="permissions"><g:message code="professor.permissions.label" default="Permissions" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'permissions', 'errors')}">
                                    
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="producoesAcademica"><g:message code="professor.producoesAcademica.label" default="Producoes Academica" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'producoesAcademica', 'errors')}">
                                    <g:select name="producoesAcademica" from="${br.atribuicoes.professor.producaoAcademica.ProducaoAcademica.list()}" multiple="yes" optionKey="id" size="5" value="${professorInstance?.producoesAcademica*.id}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="roles"><g:message code="professor.roles.label" default="Roles" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'roles', 'errors')}">
                                    
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="turmas"><g:message code="professor.turmas.label" default="Turmas" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: professorInstance, field: 'turmas', 'errors')}">
                                    
<ul>
<g:each in="${professorInstance?.turmas?}" var="t">
    <li><g:link controller="turma" action="show" id="${t.id}">${t?.encodeAsHTML()}</g:link></li>
</g:each>
</ul>
<g:link controller="turma" action="create" params="['professor.id': professorInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'turma.label', default: 'Turma')])}</g:link>

                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                    <span class="button"><g:actionSubmit class="delete" action="delete" value="${message(code: 'default.button.delete.label', default: 'Delete')}" onclick="return confirm('${message(code: 'default.button.delete.confirm.message', default: 'Are you sure?')}');" /></span>
                </div>
            </g:form>
    </body>
</html>
